<?php

namespace App\Http\Controllers\web;

use App\Http\Controllers\Controller;
use App\Repository\Repositories\PaymentRepositories;
use App\Repository\RepositoryInterface\PaymentInterface;
use Illuminate\Http\Request;
//支付类
class PaymentController extends Controller
{
    protected $pay;

    public function __construct(PaymentInterface $pay){
        $this->pay = $pay;
    }

    /**
     * 支付类型列表
     */
    public function payList(){
       return $this->pay->pay();
    }

    /**
     * @param Request $request
     * 支付类型添加
     */
    public function payInsert(Request $request){
        $data = $request->post();
        return $this->pay->payInsert($data);
    }

    /**
     * @param Request $request
     * 支付类型删除
     */
    public function payDel(Request $request){
        $id = $request->post('id');
        return $this->pay->payDel($id);
    }

    /**
     * @param Request $request
     * 支付类型修改
     */
    public function payUp(Request $request){
        $data = $request->post();
        return $this->pay->payUp($data);
    }
}
